﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace EtcpSharp
{
    partial class ClientSocketSessionServer : IClientSocketSessionServer
    {
        private IETCPSocketService ETCPSocketService { get; set; }
        internal IntPtr ClientPtr { get; set; }

        public ClientSocketSessionServer(IETCPSocketService eTCPSocketService, IntPtr clientPtr, string id)
        {
            this.ETCPSocketService = eTCPSocketService;
            this.ClientPtr = clientPtr;
            this.Id = id;
        }

        public string Id { get; set; }

        public void Colse()
        {
            this.ETCPSocketService.ColseClient(this.Id);
        }

        public void Send(string message)
        {
            this.ETCPSocketService.Send(this, new StringBuilder(message));
        }

        public void Send(StringBuilder sb)
        {
            this.ETCPSocketService.Send(this, sb);
        }
    }
}